


import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:gczn_hd/app/core/values/app_colors.dart';
import 'package:gczn_hd/app/core/values/app_values.dart';
import 'package:gczn_hd/app/modules/home/controllers/home_controller.dart';
import 'package:get/get.dart';

import '../../../core/values/App_img.dart';
import '../../../core/values/text_styles.dart';

class TopLogo extends StatelessWidget {
  final HomeController controller = Get.put(HomeController());

  final Size logoSize = const Size(207, 80);

  @override
  Widget build(BuildContext context) {

    return  Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Expanded(
          flex: 1,
          child: Container(
            alignment: Alignment.topLeft,
            child: Image.asset(AppImg.loginLogo, width:  logoSize.width.w, height: logoSize.height.h,),
          ),
        ),
        GestureDetector(
          onTap: (){
            Scaffold.of(context).openEndDrawer();
          },
          child: Container(
              child: Row(
                children: [
                  Image.asset(AppImg.userPicture, width:  AppValues.size76.w, height: AppValues.size76.w,),
                  SizedBox(width: AppValues.size24.w,),
                  Column(
                    mainAxisSize: MainAxisSize.min,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Obx(() => Text(controller.userData.value.name ?? '匿名员工', style: TextStyle(
                          color: AppColors.colorWhite,
                          fontSize: AppValues.margin_30.sp
                      ),)),
                      Obx(() => Text(controller.userData.value.positionName ?? '无职位', style: TextStyle(color: AppColors.colorWhite.withOpacity(AppValues.decimals8), fontSize: AppValues.size24.sp),))
                    ],
                  ),
                  SizedBox(width: AppValues.size24.w,),
                  Image.asset(AppImg.arrowRight, width:  AppValues.margin_12.w, height: AppValues.size24.w,),
                ],
              )
          )
        )
      ],
    );
  }


 }